//
//  DLPageSegmentView.h
//  DLPageSegmentView
//
//  Created by 伍明鹏 on 2019/12/17.
//

#import <UIKit/UIKit.h>


@class DLPageSegmentView;


@protocol DLPageSegmentViewDelegate <NSObject>

@required
//Tab标签数量
- (NSUInteger)numberOfPagers:(DLPageSegmentView *)view;
//每Tab标签下自定义的控制器
- (UIViewController *)pagerViewOfPagers:(DLPageSegmentView *)view indexOfPagers:(NSUInteger)number;
@optional

// 切换到不同pager可执行的事件

- (void)whenSelectOnPager:(NSUInteger)number;

@end



@interface DLPageSegmentView : UIView
//代理
@property (nonatomic, weak)   id<DLPageSegmentViewDelegate> delegate;

///UI显示设置
//标签背景色
@property (nonatomic, strong) UIColor* tabBackgroundColor;
//标签字体颜色
@property (nonatomic, strong) UIColor* tabButtonTitleColorForNormal;
//标签选中字体颜色
@property (nonatomic, strong) UIColor* tabButtonTitleColorForSelected;
//标签栏高度
@property (nonatomic, assign) CGFloat  tabFrameHeight;
//标签字体大小
@property (nonatomic, assign) UIFont *tabButtonFont;
//标签未选中字体大小
@property (nonatomic, assign) UIFont *tabButtonNormalFont;
//标签栏边距
@property (nonatomic, assign) CGFloat  tabMargin;
//标签选中下划线宽度
@property (nonatomic, assign) CGFloat  selectedLineWidth;
//标签选中下划线宽度相对标题宽度比例
@property (nonatomic, assign) CGFloat  selectedLineWidthScale;
//标签选中下划线高度
@property (nonatomic, assign) CGFloat  selectedLineHeight;
//标签选中下划线圆角
@property (nonatomic, assign) CGFloat  selectedLineCorner;

@property (nonatomic, assign) UIColor *selectedLineColor;

//标签选中下划线圆角
@property (nonatomic, assign) BOOL bottomLineHiden;

/*!
 * @brief 自定义完毕后开始build UI（required）
 */
- (void)buildUI;
/*!
 * @brief 控制选中tab的button, 默认index = 0
 */
- (void)selectTabWithIndex:(NSUInteger)index animate:(BOOL)isAnimate;
- (void)showRedDotWithIndex:(NSUInteger)index;
- (void)hideRedDotWithIndex:(NSUInteger)index;

@end
